<template>
  <div class="boundary">
    <n-popover trigger="hover" placement="right-start">
      <template #trigger>
        <div class="nav-button" :class="selected ? 'selected' : ''">
          <el-image :src="src" alt="" />
        </div>
      </template>
      <span>{{ msg }}</span>
    </n-popover>
  </div>
</template>
<script setup lang="ts">
import { defineProps } from "vue";

withDefaults(
  defineProps<{
    src?: string;
    msg?: string;
    selected?: boolean;
  }>(),
  {
    src: "src/assets/icon/youxi.png",
    msg: "私信",
    selected: false,
  }
);
</script>

<style scoped>
.boundary {
  width: 100%;
  height: 65px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-button {
  width: 48px;
  height: 48px;

  background: white;
  /*圆角*/
  border-radius: 10px;

  display: flex;
  justify-content: center;
  align-items: center;

  transition: transform 0.2s ease-in-out;
}

.nav-button:hover {
  /*放大*/
  transform: scale(1.1);
  /*过度*/
  transition: transform 0.2s ease-in-out;
}

.selected {
  /*边框*/
  border: 1px solid #00ff00;
}

.el-image {
  width: 75%;
}

span {
  font-size: 12px;
}
</style>
